Optimal. Leaf size=150 \[ \frac {(d+e x)^2}{4 e}+\frac {(2 c d-b e) \sqrt {\pi } \cos \left (2 a-\frac {b^2}{2 c}\right ) \text {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right )}{8 c^{3/2}}-\frac {(2 c d-b e) \sqrt {\pi } S\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right ) \sin \left (2 a-\frac {b^2}{2 c}\right )}{8 c^{3/2}}+\frac {e \sin \left (2 a+2 b x+2 c x^2\right )}{8 c} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 150, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {3549, 3543,
3529, 3433, 3432} \begin {gather*} \frac {\sqrt {\pi } \cos \left (2 a-\frac {b^2}{2 c}\right ) (2 c d-b e) \text {FresnelC}\left (\frac {b+2 c x}{\sqrt {\pi } \sqrt {c}}\right )}{8 c^{3/2}}-\frac {\sqrt {\pi } \sin \left (2 a-\frac {b^2}{2 c}\right ) (2 c d-b e) S\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right )}{8 c^{3/2}}+\frac {e \sin \left (2 a+2 b x+2 c x^2\right )}{8 c}+\frac {(d+e x)^2}{4 e} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3432
Rule 3433
Rule 3529
Rule 3543
Rule 3549
Rubi steps
\begin {align*} \int (d+e x) \cos ^2\left (a+b x+c x^2\right ) \, dx &=\int \left (\frac {1}{2} (d+e x)+\frac {1}{2} (d+e x) \cos \left (2 a+2 b x+2 c x^2\right )\right ) \, dx\\ &=\frac {(d+e x)^2}{4 e}+\frac {1}{2} \int (d+e x) \cos \left (2 a+2 b x+2 c x^2\right ) \, dx\\ &=\frac {(d+e x)^2}{4 e}+\frac {e \sin \left (2 a+2 b x+2 c x^2\right )}{8 c}+\frac {(4 c d-2 b e) \int \cos \left (2 a+2 b x+2 c x^2\right ) \, dx}{8 c}\\ &=\frac {(d+e x)^2}{4 e}+\frac {e \sin \left (2 a+2 b x+2 c x^2\right )}{8 c}+\frac {\left ((2 c d-b e) \cos \left (2 a-\frac {b^2}{2 c}\right )\right ) \int \cos \left (\frac {(2 b+4 c x)^2}{8 c}\right ) \, dx}{4 c}-\frac {\left ((2 c d-b e) \sin \left (2 a-\frac {b^2}{2 c}\right )\right ) \int \sin \left (\frac {(2 b+4 c x)^2}{8 c}\right ) \, dx}{4 c}\\ &=\frac {(d+e x)^2}{4 e}+\frac {(2 c d-b e) \sqrt {\pi } \cos \left (2 a-\frac {b^2}{2 c}\right ) C\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right )}{8 c^{3/2}}-\frac {(2 c d-b e) \sqrt {\pi } S\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right ) \sin \left (2 a-\frac {b^2}{2 c}\right )}{8 c^{3/2}}+\frac {e \sin \left (2 a+2 b x+2 c x^2\right )}{8 c}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.44, size = 139, normalized size = 0.93 \begin {gather*} \frac {(2 c d-b e) \sqrt {\pi } \cos \left (2 a-\frac {b^2}{2 c}\right ) \text {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right )-(2 c d-b e) \sqrt {\pi } S\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right ) \sin \left (2 a-\frac {b^2}{2 c}\right )+\sqrt {c} (2 c x (2 d+e x)+e \sin (2 (a+x (b+c x))))}{8 c^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.14, size = 170, normalized size = 1.13
method | result | size |
default | \(\frac {e \sin \left (2 c \,x^{2}+2 b x +2 a \right )}{8 c}-\frac {e b \sqrt {\pi }\, \left (\cos \left (\frac {-4 a c +b^{2}}{2 c}\right ) \FresnelC \left (\frac {2 c x +b}{\sqrt {c}\, \sqrt {\pi }}\right )+\sin \left (\frac {-4 a c +b^{2}}{2 c}\right ) \mathrm {S}\left (\frac {2 c x +b}{\sqrt {c}\, \sqrt {\pi }}\right )\right )}{8 c^{\frac {3}{2}}}+\frac {\sqrt {\pi }\, d \left (\cos \left (\frac {-4 a c +b^{2}}{2 c}\right ) \FresnelC \left (\frac {2 c x +b}{\sqrt {c}\, \sqrt {\pi }}\right )+\sin \left (\frac {-4 a c +b^{2}}{2 c}\right ) \mathrm {S}\left (\frac {2 c x +b}{\sqrt {c}\, \sqrt {\pi }}\right )\right )}{4 \sqrt {c}}+\frac {d x}{2}+\frac {e \,x^{2}}{4}\) | \(170\) |
risch | \(\frac {e \,x^{2}}{4}+\frac {d x}{2}+\frac {d \sqrt {\pi }\, {\mathrm e}^{-\frac {i \left (4 a c -b^{2}\right )}{2 c}} \sqrt {2}\, \erf \left (\sqrt {2}\, \sqrt {i c}\, x +\frac {i b \sqrt {2}}{2 \sqrt {i c}}\right )}{16 \sqrt {i c}}-\frac {e b \sqrt {\pi }\, {\mathrm e}^{-\frac {i \left (4 a c -b^{2}\right )}{2 c}} \sqrt {2}\, \erf \left (\sqrt {2}\, \sqrt {i c}\, x +\frac {i b \sqrt {2}}{2 \sqrt {i c}}\right )}{32 c \sqrt {i c}}-\frac {d \sqrt {\pi }\, {\mathrm e}^{\frac {i \left (4 a c -b^{2}\right )}{2 c}} \erf \left (-\sqrt {-2 i c}\, x +\frac {i b}{\sqrt {-2 i c}}\right )}{8 \sqrt {-2 i c}}+\frac {e b \sqrt {\pi }\, {\mathrm e}^{\frac {i \left (4 a c -b^{2}\right )}{2 c}} \erf \left (-\sqrt {-2 i c}\, x +\frac {i b}{\sqrt {-2 i c}}\right )}{16 c \sqrt {-2 i c}}+\frac {e \sin \left (2 c \,x^{2}+2 b x +2 a \right )}{8 c}\) | \(257\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] Result contains complex when optimal does not.
time = 0.78, size = 738, normalized size = 4.92 \begin {gather*} -\frac {{\left (4^{\frac {1}{4}} \sqrt {2} \sqrt {\pi } {\left ({\left (\left (i - 1\right ) \, \cos \left (-\frac {b^{2} - 4 \, a c}{2 \, c}\right ) + \left (i + 1\right ) \, \sin \left (-\frac {b^{2} - 4 \, a c}{2 \, c}\right )\right )} \operatorname {erf}\left (\frac {2 i \, c x + i \, b}{\sqrt {2 i \, c}}\right ) + {\left (\left (i + 1\right ) \, \cos \left (-\frac {b^{2} - 4 \, a c}{2 \, c}\right ) + \left (i - 1\right ) \, \sin \left (-\frac {b^{2} - 4 \, a c}{2 \, c}\right )\right )} \operatorname {erf}\left (\frac {2 i \, c x + i \, b}{\sqrt {-2 i \, c}}\right )\right )} c^{\frac {3}{2}} - 16 \, c^{2} x\right )} d}{32 \, c^{2}} + \frac {\sqrt {2} {\left ({\left (\left (i - 1\right ) \, \sqrt {2} \sqrt {\pi } {\left (\operatorname {erf}\left (\sqrt {\frac {1}{2}} \sqrt {\frac {4 i \, c^{2} x^{2} + 4 i \, b c x + i \, b^{2}}{c}}\right ) - 1\right )} - \left (i + 1\right ) \, \sqrt {2} \sqrt {\pi } {\left (\operatorname {erf}\left (\sqrt {\frac {1}{2}} \sqrt {-\frac {4 i \, c^{2} x^{2} + 4 i \, b c x + i \, b^{2}}{c}}\right ) - 1\right )}\right )} b^{2} \cos \left (-\frac {b^{2} - 4 \, a c}{2 \, c}\right ) + {\left (\left (i + 1\right ) \, \sqrt {2} \sqrt {\pi } {\left (\operatorname {erf}\left (\sqrt {\frac {1}{2}} \sqrt {\frac {4 i \, c^{2} x^{2} + 4 i \, b c x + i \, b^{2}}{c}}\right ) - 1\right )} - \left (i - 1\right ) \, \sqrt {2} \sqrt {\pi } {\left (\operatorname {erf}\left (\sqrt {\frac {1}{2}} \sqrt {-\frac {4 i \, c^{2} x^{2} + 4 i \, b c x + i \, b^{2}}{c}}\right ) - 1\right )}\right )} b^{2} \sin \left (-\frac {b^{2} - 4 \, a c}{2 \, c}\right ) - 2 \, {\left ({\left (-\left (i - 1\right ) \, \sqrt {2} \sqrt {\pi } {\left (\operatorname {erf}\left (\sqrt {\frac {1}{2}} \sqrt {\frac {4 i \, c^{2} x^{2} + 4 i \, b c x + i \, b^{2}}{c}}\right ) - 1\right )} + \left (i + 1\right ) \, \sqrt {2} \sqrt {\pi } {\left (\operatorname {erf}\left (\sqrt {\frac {1}{2}} \sqrt {-\frac {4 i \, c^{2} x^{2} + 4 i \, b c x + i \, b^{2}}{c}}\right ) - 1\right )}\right )} b c \cos \left (-\frac {b^{2} - 4 \, a c}{2 \, c}\right ) + {\left (-\left (i + 1\right ) \, \sqrt {2} \sqrt {\pi } {\left (\operatorname {erf}\left (\sqrt {\frac {1}{2}} \sqrt {\frac {4 i \, c^{2} x^{2} + 4 i \, b c x + i \, b^{2}}{c}}\right ) - 1\right )} + \left (i - 1\right ) \, \sqrt {2} \sqrt {\pi } {\left (\operatorname {erf}\left (\sqrt {\frac {1}{2}} \sqrt {-\frac {4 i \, c^{2} x^{2} + 4 i \, b c x + i \, b^{2}}{c}}\right ) - 1\right )}\right )} b c \sin \left (-\frac {b^{2} - 4 \, a c}{2 \, c}\right )\right )} x + 2 \, \sqrt {2} {\left (4 \, c^{2} x^{2} - c {\left (i \, e^{\left (\frac {4 i \, c^{2} x^{2} + 4 i \, b c x + i \, b^{2}}{2 \, c}\right )} - i \, e^{\left (-\frac {4 i \, c^{2} x^{2} + 4 i \, b c x + i \, b^{2}}{2 \, c}\right )}\right )} \cos \left (-\frac {b^{2} - 4 \, a c}{2 \, c}\right ) + c {\left (e^{\left (\frac {4 i \, c^{2} x^{2} + 4 i \, b c x + i \, b^{2}}{2 \, c}\right )} + e^{\left (-\frac {4 i \, c^{2} x^{2} + 4 i \, b c x + i \, b^{2}}{2 \, c}\right )}\right )} \sin \left (-\frac {b^{2} - 4 \, a c}{2 \, c}\right )\right )} \sqrt {\frac {4 \, c^{2} x^{2} + 4 \, b c x + b^{2}}{c}}\right )} e}{64 \, c^{2} \sqrt {\frac {4 \, c^{2} x^{2} + 4 \, b c x + b^{2}}{c}}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.40, size = 155, normalized size = 1.03 \begin {gather*} \frac {2 \, c^{2} x^{2} e + 4 \, c^{2} d x + 2 \, c \cos \left (c x^{2} + b x + a\right ) e \sin \left (c x^{2} + b x + a\right ) + {\left (2 \, \pi c d - \pi b e\right )} \sqrt {\frac {c}{\pi }} \cos \left (-\frac {b^{2} - 4 \, a c}{2 \, c}\right ) \operatorname {C}\left (\frac {{\left (2 \, c x + b\right )} \sqrt {\frac {c}{\pi }}}{c}\right ) - {\left (2 \, \pi c d - \pi b e\right )} \sqrt {\frac {c}{\pi }} \operatorname {S}\left (\frac {{\left (2 \, c x + b\right )} \sqrt {\frac {c}{\pi }}}{c}\right ) \sin \left (-\frac {b^{2} - 4 \, a c}{2 \, c}\right )}{8 \, c^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (d + e x\right ) \cos ^{2}{\left (a + b x + c x^{2} \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [C] Result contains complex when optimal does not.
time = 0.51, size = 304, normalized size = 2.03 \begin {gather*} \frac {1}{4} \, x^{2} e + \frac {1}{2} \, d x - \frac {\sqrt {\pi } d \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {c} {\left (2 \, x + \frac {b}{c}\right )} {\left (-\frac {i \, c}{{\left | c \right |}} + 1\right )}\right ) e^{\left (-\frac {i \, b^{2} - 4 i \, a c}{2 \, c}\right )}}{8 \, \sqrt {c} {\left (-\frac {i \, c}{{\left | c \right |}} + 1\right )}} - \frac {\sqrt {\pi } d \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {c} {\left (2 \, x + \frac {b}{c}\right )} {\left (\frac {i \, c}{{\left | c \right |}} + 1\right )}\right ) e^{\left (-\frac {-i \, b^{2} + 4 i \, a c}{2 \, c}\right )}}{8 \, \sqrt {c} {\left (\frac {i \, c}{{\left | c \right |}} + 1\right )}} + \frac {\frac {\sqrt {\pi } b \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {c} {\left (2 \, x + \frac {b}{c}\right )} {\left (-\frac {i \, c}{{\left | c \right |}} + 1\right )}\right ) e^{\left (-\frac {i \, b^{2} - 4 i \, a c - 2 \, c}{2 \, c}\right )}}{\sqrt {c} {\left (-\frac {i \, c}{{\left | c \right |}} + 1\right )}} - i \, e^{\left (2 i \, c x^{2} + 2 i \, b x + 2 i \, a + 1\right )}}{16 \, c} + \frac {\frac {\sqrt {\pi } b \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {c} {\left (2 \, x + \frac {b}{c}\right )} {\left (\frac {i \, c}{{\left | c \right |}} + 1\right )}\right ) e^{\left (-\frac {-i \, b^{2} + 4 i \, a c - 2 \, c}{2 \, c}\right )}}{\sqrt {c} {\left (\frac {i \, c}{{\left | c \right |}} + 1\right )}} + i \, e^{\left (-2 i \, c x^{2} - 2 i \, b x - 2 i \, a + 1\right )}}{16 \, c} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\cos \left (c\,x^2+b\,x+a\right )}^2\,\left (d+e\,x\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________